<template>
  <div class="one">
    <three-dog :list="list" @addFn="addFn" />
    <three-like :newList="newList" />
  </div>
</template>

<script>
import threeDog from "./components/likedog.vue";
import threeLike from "./components/hhh.vue";
export default {
  components: {
    threeDog,
    threeLike,
  },
  data() {
    return {
      // myIndex: "",
      newList: [],
      list: [
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是001",
        },
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是002",
        },
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是003",
        },
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是004",
        },
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是005",
        },
        {
          imgSrc: "http://destiny001.gitee.io/image/cxk.gif",
          text: "我是006",
        },
      ],
    };
  },
  methods: {
    addFn(index) {
      let obj = this.list.find((item, index1) => {
        return index1 === index;
      });
      this.newList.push(obj);
    },
  },
};
</script>

<style scoped>
.one {
  display: flex;
}
</style>
